<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <meta name="author" content="http://jeesite.com/"/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=8,IE=9,IE=10"/>
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store">
    <script src="/static/jquery/jquery-3.4.0.min.js" type="text/javascript"></script>
    <link href="/static/bootstrap/2.3.1/css_cerulean/bootstrap.min.css"
          type="text/css" rel="stylesheet"/>
    <script src="/static/bootstrap/2.3.1/js/bootstrap.min.js" type="text/javascript"></script>
    <link href="/static/bootstrap/2.3.1/awesome/font-awesome.min.css" type="text/css" rel="stylesheet"/>
    <link href="/static/jquery-select2/3.4/select2.min.css" rel="stylesheet"/>
    <script src="/static/jquery-select2/3.4/select2.min.js" type="text/javascript"></script>
    <link href="/static/jquery-validation/1.11.0/jquery.validate.min.css" type="text/css" rel="stylesheet"/>
    <script src="/static/jquery-validation/1.19.0/jquery.validate.min.js" type="text/javascript"></script>
    <link href="/static/jquery-jbox/2.3/Skins/Bootstrap/jbox.min.css" rel="stylesheet"/>
    <script src="/static/jquery-jbox/2.3/jquery.jBox-2.3.min.js" type="text/javascript"></script>
    <script src="/static/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="/static/common/mustache.min.js" type="text/javascript"></script>
    <link href="/static/common/jeesite.min.css" type="text/css" rel="stylesheet"/>
    <script src="/static/common/jeesite.min.js" type="text/javascript"></script>
    <link rel="Stylesheet" href="/static/jerichotab/css/jquery.jerichotab.css" />
    <script type="text/javascript" src="/static/jerichotab/js/jquery.jerichotab.js"></script>
    <title>首页</title>
    <meta name="decorator" content="blank"/>
    <style type="text/css">
        #main {padding:0;margin:0;} #main .container-fluid{padding:0 4px 0 6px;}
        #header {margin:0 0 8px;position:static;} #header li {font-size:14px;_font-size:12px;}
        #header .brand {font-family:Helvetica, Georgia, Arial, sans-serif, 黑体;font-size:26px;padding-left:33px;}
        #footer {margin:8px 0 0 0;padding:3px 0 0 0;font-size:11px;text-align:center;border-top:2px solid #0663A2;}
        #footer, #footer a {color:#999;} #left{overflow-x:hidden;overflow-y:auto;} #left .collapse{position:static;}
        #userControl>li>a{/*color:#fff;*/text-shadow:none;} #userControl>li>a:hover, #user #userControl>li.open>a{background:transparent;}
    </style>
    <script type="text/javascript">
        var leftWidth = 160; // 左侧窗口大小
        var tabTitleHeight = 33; // 页签的高度
        var htmlObj = $("html"), mainObj = $("#main");
        var headerObj = $("#header"), footerObj = $("#footer");
        var frameObj = $("#left, #openClose, #right, #right iframe");
        $(document).ready(function () {
            //  初始化页签
            $.fn.initJerichoTab({
                renderTo: '#right', uniqueId: 'jerichotab',
                contentCss: {'height': $('#right').height() - tabTitleHeight},
                tabs: [], loadOnce: true, tabWidth: 110, titleHeight: tabTitleHeight
            });
            // 绑定菜单单击事件
            $("#menu a.menu").click(function () {
                // 一级菜单焦点
                $("#menu li.menu").removeClass("active");
                $(this).parent().addClass("active");
                // 左侧区域隐藏
                if ($(this).attr("target") == "mainFrame") {
                    $("#left,#openClose").hide();
                    wSizeWidth();
                    //隐藏页签
                    $(".jericho_tab").hide();
                    $("#mainFrame").show();
                    return true;
                }
                // 左侧区域显示
                $("#left,#openClose").show();
                if (!$("#openClose").hasClass("close")) {
                    $("#openClose").click();
                }
                // 显示二级菜单
                var menuId = "#menu-" + $(this).attr("data-id");
                if ($(menuId).length > 0) {
                    $("#left .accordion").hide();
                    $(menuId).show();
                    // 初始化点击第一个二级菜单
                    if (!$(menuId + " .accordion-body:first").hasClass('in')) {
                        $(menuId + " .accordion-heading:first a").click();
                    }
                    if (!$(menuId + " .accordion-body li:first ul:first").is(":visible")) {
                        $(menuId + " .accordion-body a:first i").click();
                    }
                    // 初始化点击第一个三级菜单
                    $(menuId + " .accordion-body li:first li:first a:first i").click();
                } else {
                    // 获取二级菜单数据
                    $.get($(this).attr("data-href"), function (data) {
                        if (data.indexOf("id=\"loginForm\"") != -1) {
                            alert('未登录或登录超时。请重新登录，谢谢！');
                            top.location = "";
                            return false;
                        }
                        $("#left .accordion").hide();
                        $("#left").append(data);
                        // 链接去掉虚框
                        $(menuId + " a").bind("focus", function () {
                            if (this.blur) {
                                this.blur()
                            }
                            ;
                        });
                        // 二级标题
                        $(menuId + " .accordion-heading a").click(function () {
                            $(menuId + " .accordion-toggle i").removeClass('icon-chevron-down').addClass('icon-chevron-right');
                            if (!$($(this).attr('data-href')).hasClass('in')) {
                                $(this).children("i").removeClass('icon-chevron-right').addClass('icon-chevron-down');
                            }
                        });
                        // 二级内容
                        $(menuId + " .accordion-body a").click(function () {
                            $(menuId + " li").removeClass("active");
                            $(menuId + " li i").removeClass("icon-white");
                            $(this).parent().addClass("active");
                            $(this).children("i").addClass("icon-white");
                        });
                        // 展现三级
                        $(menuId + " .accordion-inner a").click(function () {
                            var href = $(this).attr("data-href");
                            if ($(href).length > 0) {
                                $(href).toggle().parent().toggle();
                                return false;
                            }
                            // 打开显示页签
                            return addTab($(this));
                        });
                        // 默认选中第一个菜单
                        $(menuId + " .accordion-body a:first i").click();
                        $(menuId + " .accordion-body li:first li:first a:first i").click();
                    });
                }
                // 大小宽度调整
                wSizeWidth();
                return false;
            });
            // 初始化点击第一个一级菜单
            $("#menu a.menu:first span").click();
            //  下拉菜单以选项卡方式打开
            $("#userInfo .dropdown-menu a").mouseup(function () {
                return addTab($(this), true);
            });
            // 鼠标移动到边界自动弹出左侧菜单
            $("#openClose").mouseover(function () {
                if ($(this).hasClass("open")) {
                    $(this).click();
                }
            });
        });

        // 添加一个页签
        function addTab($this, refresh) {
            $(".jericho_tab").show();
            $("#mainFrame").hide();
            $.fn.jerichoTab.addTab({
                tabFirer: $this,
                title: $this.text(),
                closeable: true,
                data: {
                    dataType: 'iframe',
                    dataLink: $this.attr('href')
                }
            }).loadData(refresh);
            return false;
        }

        function newTab(title,url,refresh){
            $.fn.jerichoTab.addTab({
                title: title,
                closeable: true,
                data: {
                    dataType: 'iframe',
                    dataLink: url
                }
            }).loadData(refresh);
        }
    </script>
</head>
<body>
<div id="main">
    <div id="header" class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <div class="brand"><span id="productName"></span></div>
            <ul id="userControl" class="nav pull-right">
                <!--<li id="themeSwitch" class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#" title="主题切换"><i
                            class="icon-th-large"></i></a>
                    <ul class="dropdown-menu">
                    </ul>
                    &lt;!&ndash;[if lte IE 6]>
                    <script type="text/javascript">$('#themeSwitch').hide();</script><![endif]&ndash;&gt;
                </li>-->
                <li id="userInfo" class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#" title="个人信息">您好&nbsp;<span id="notifyNum"
                                                                                                          class="label label-info" th:text="${session.user.username}"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="/sys/user/info" target="mainFrame"><i class="icon-user"></i>&nbsp; 个人信息</a>
                        </li>
                        <li><a href="/sys/user/modifyPwd" target="mainFrame"><i class="icon-lock"></i>&nbsp; 修改密码</a>
                        </li>
                    </ul>
                </li>
                <li><a href="/logout" title="退出登录">退出</a></li>
                <li>&nbsp;</li>
            </ul>

            <div class="nav-collapse">
                <ul id="menu" class="nav" style="*white-space:nowrap;float:none;"
                    th:each="menu,menustats:${menus}">
                    <li th:class="'menu ' + ${menustats.index==0?'active':''}">
                        <!--<a class="menu"-->
                           <!--th:href="'/user/menuTree/' + ${menu.id}"-->
                           <!--th:onclick="'getMenuTree(\''+${menu.id}+'\');'"-->
                           <!--target="menuFrame">-->
                            <!--<span th:text="${menu.name}"></span></a>-->
                        <!--<a class="menu"-->
                           <!--th:href="'/user/menuTree/' + ${menu.id}"-->
                           <!--th:data-id="${menu.id}"-->
                           <!--target="menuFrame"><span th:text="${menu.name}"></span></a>-->
                        <a class="menu"
                           href="javascript:"
                           th:data-href="'/user/menuTree/' + ${menu.id}"
                           th:data-id="${menu.id}">
                            <span th:text="${menu.name}"></span></a>
                        </a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <div class="container-fluid">
        <div id="content" class="row-fluid">
            <div id="left">
            </div>
            <div id="openClose" class="close">&nbsp;</div>
            <div id="right">
                <iframe id="mainFrame" name="mainFrame" style="overflow:visible;" scrolling="yes"
                        frameborder="no" width="100%" height="650"></iframe>
            </div>
        </div>
        <div id="footer" class="row-fluid"
             th:replace="~{common/copyright :: copyright(startyear=2000,endyear=3000)}">
            Copyright &copy; 2012-2030 ${fns:getConfig('productName')} - Powered By <a href="http://jeesite.com"
                                                                                       target="_blank">JeeSite</a>
            ${fns:getConfig('version')}
        </div>
        <div id="dd" class="row-fluid"
             th:replace="~{common/menuTreeDiv :: menutree(1,1,'div','div')}">
            Copyright &copy; 2012-2030 ${fns:getConfig('productName')} - Powered By <a href="http://jeesite.com"
                                                                                       target="_blank">JeeSite</a>
            ${fns:getConfig('version')}
        </div>
    </div>
</div>
<script type="text/javascript">
    function wSize(){
        var minHeight = 500, minWidth = 980;
        var strs = getWindowSize().toString().split(",");
        htmlObj.css({"overflow-x":strs[1] < minWidth ? "auto" : "hidden", "overflow-y":strs[0] < minHeight ? "auto" : "hidden"});
        mainObj.css("width",strs[1] < minWidth ? minWidth - 10 : "auto");
        frameObj.height((strs[0] < minHeight ? minHeight : strs[0]) - headerObj.height() - footerObj.height() - (strs[1] < minWidth ? 42 : 28));
        $("#openClose").height($("#openClose").height() - 5);
        $(".jericho_tab iframe").height($("#right").height() - tabTitleHeight);
        wSizeWidth();
    }
    function wSizeWidth(){
        if (!$("#openClose").is(":hidden")){
            var leftWidth = ($("#left").width() < 0 ? 0 : $("#left").width());
            $("#right").width($("#content").width()- leftWidth - $("#openClose").width() -5);
        }else{
            $("#right").width("100%");
        }
    }

    function openCloseClickCallBack(b){
        $.fn.jerichoTab.resize();
    }
</script>
<script src="/static/common/wsize.min.js" type="text/javascript"></script>
</body>
</html>